﻿using Devbridge.IPolice.DomainModel;
using FluentNHibernate.Mapping;

namespace Devbridge.IPolice.Repositories.Mappings
{
    public class CrimeMap : ClassMap<Crime>
    {
        public CrimeMap()
        {
            Table("Crime");

            Id(f => f.Id).GeneratedBy.Identity();

            Map(f => f.Description);
            Map(f => f.ProofImagePath);
            Map(f => f.Date);

            References(f => f.Offender).Column("OffenderId");
            References(f => f.AssignedPoliceOfficer).Column("PoliceOfficerId");
        }
    }
}
